
public class Video {
	
	/*;
	 !open *Field declarations*
	 The function of this class is to represent a video object. Therefore, the
	 field declarations associate properties that would be useful when indexing
	 a video collection:
	 ;*/
	private String title;
	private String director;
	private int playingTime;
	private boolean gotIt;
	private String comment;
	/*;
	 !shut Here, we can see that we will store a title, |director|, playing time,
	 representation of whether we own it, and an optional comment about the
	 video. They are all declared as private, which means that they can only
	 be accessed from within this class.
	 ;*/
	
	/*;
	 !open *Constructor*
	 The constructor defines the actions to be taken upon creation of a video object.
	 We can see here that this class requires 3 different parameters. These are a
	 title, the name of the director and the running time of the video. 
	 ;*/
	public Video(String theTitle, String theDirector, int time) {
		title = theTitle;
		director = theDirector;
		playingTime = time;
		gotIt = false;
		comment = "";
	}
	/*;
	 !shut The 3 variables declared on the class scope are set to the three matching
	 parameters. The remaining two, gotIt and comment, are set to default values. They
	 can be changed later by using |accessor| and |mutator| methods. 
	 ;*/
	
	/*;
	 !open *Setting a comment*
	 We can set the value of a comment at any time with a |mutator| method, as shown below. 
	 ;*/
	public void setComment(String comment)
	{
		this.comment = comment;
	}
	/*;
	 !shut This is very useful - for example, we might think that the Matrix is an excellent
	 film for a year, but then decide differently; we will want to update the database to 
	 reflect this!
	 ;*/
	
	public String getComment() {
		return comment;
	}
	
	public void setOwn(boolean ownIt) {
		gotIt = ownIt;
	}
	
	public boolean getOwn() {
		return gotIt;
	}
	
	/*;
	 !open *Printing to the console*
	 We may want to find out information about any particular video. We can print to the
	 console by calling this print method. 
	 ;*/
	public void print() {
		System.out.println("Video: " + title + 
				" (" + playingTime + " mins.");
		
		if(gotIt) {
			System.out.println("*");
		}
		
		System.out.println(" " + director);
		System.out.println(" " + comment);
	}
	/*;
	 !shut The first print statement is run unconditionally. It prints the title and playing time.
	 The conditional that uses |gotIt| will print a star character next to the text if we own it or
	 not. The final two print statements add the director and the comment on separate lines.
	 ;*/
}
